#include "pch.h"
#include "Handle.h"

int main()
{
#ifdef _WIN32
    const std::string shareLibPath = "../testShared/build/Debug/test.dll";
#endif
#ifdef __linux__
    const std::string shareLibPath = "testShared/build/libtest.so";
#endif

    typedef int (*MyFunc)(int, int);

    Shared::LibHandle handle;
    
    if(!handle.Open(shareLibPath.c_str()))
    {
        LOGI("failed Load the shared lib");
        return 0;
    }
    LOGI("Load the shared Lib");

    MyFunc func = handle.GetProcAddrAs<MyFunc>("hello");

    int res = func(11, 12);
    LOGI("res is %d", res);

    handle.Close();
};

